<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>两栏布局</title>
    <style>
        /* 左边浮动 */
        /* .box {
            overflow: hidden;
        }

        .left {
            float: left;
            width: 200px;
            background-color: aquamarine;
            height: 1000px;
        }

        .right {
            background-color: bisque;
            height: 1000px;
        } */

        /* 将左侧div进行绝对定位，然后右侧div设置margin-left: 200px */
        /* .box {
            position: relative;
        }

        .left {
            width: 200px;
            height: 200px;
            background-color: red;
            position: absolute;
        }

        .right {
            height: 200px;
            background-color: blue;
            margin-left: 200px;
        } */
        /* 对右侧:div进行绝对定位，然后再设置right=0，即可以实现宽度自适应 */
        .box {
            position: relative;
        }

        .left {
            width: 200px;
            height: 200px;
            background-color: red;
        }

        .right {
            height: 200px;
            background-color: blue;
            position: absolute;
            left: 200px;
            top: 0;
            right: 0;
        }

        /* flex布局 */
        /* .box {
            display: flex;
            align-items: flex-start
        }

        .left {
            width: 200px;
            background-color: blueviolet;
            height: 1000px;
        }

        .right {
            flex: 1;
            background-color: brown;
        } */
    </style>
</head>

<body>
    <div class="box">
        <div class="left">
            侧边栏
        </div>
        <div class="right">
            内容区
        </div>
    </div>
</body>

</html>